<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	WikiForm form = (WikiForm)request.getAttribute("command");
	TcaKnowledgefile item = (TcaKnowledgefile)request.getAttribute("item");
	List<TcaKnowledgefolder> folderList = (List<TcaKnowledgefolder>)request.getAttribute("folderList");
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String userId = user.getUsername();
	String userName = user.getName();
%>

<div>
	<form id="noticeAddForm" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/wiki/item/doEdit"
	enctype="multipart/form-data">
		<input type="hidden" name="itemId" value="<%=item.getSeqid()%>">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>修改条目</li>
			</ul>
		</div>
		<table class="formTable">
			<tr>
				<td class="tdTitle">标题：</td>
				<td>
					<input class="inputText l" type="text" value="<%=item.getTitle()%>" name="title">
					<span class="errorTipWrap" id="errorTip_title"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">所属目录：</td>
				<td>
					<select name="folderId">
						<%
							for(TcaKnowledgefolder folder:folderList){
								%>
									<option value="<%=folder.getFolderid()%>" <%=item.getFolderid().equalsIgnoreCase(folder.getFolderid())?"selected=selected":""%>><%=folder.getTitle()%></option>
								<%
							}
						%>
					</select>
					<span class="errorTipWrap" id="errorTip_title"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">详细内容：</td>
				<td class="" colspan="2">
					<div style="padding-top:10px;padding-bottom:10px;">
					<textarea id="notice_content" class="notice_content" name="content" 
					style=" visibility: hidden;"><%=StringUtils.isNotBlank(item.getContent())?item.getContent():"" %>   </textarea>
					</div>
					<span class="errorTipWrap" id="errorTip_content"></span>
				</td>
			</tr>
			
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.WIKI.item_manage()">取消</a>
					</div>
				</td>
			</tr>	
		</table>
		<input name="mobiles" type="hidden">
	</form>
	
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>
<script type="text/javascript">
	$(function() {
		XF.createKindEditor("notice_content");
		$("input[name=title]").focus();//主动指定焦点，防止ie的bug
		XF.Notice.init();
	});
</script>



